home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / WPJV1N2.ZIP / HAXTON.ZIP / WNDPROC.C < prev   
C/C++ Source or Header  |  1993-01-27  |  1KB  |  80 lines

  1. //*********************************************************
  2. //* 
  3. //* wndproc.c: the main windows processing function
  4. //*
  5. //*********************************************************
  6.  
  7. #define    NOCOMM
  8. #define    _WINDOWS
  9.  
  10. #include    <windows.h>
  11. #include <stdio.h>
  12. #include    "rodsapp.h"
  13. #include "dlls.h"
  14.  
  15. LONG FAR PASCAL MainWndProc(HWND hWnd, unsigned message, WORD wParam,
  16.                                     LONG lParam)
  17. {
  18.     /* local variables */
  19.     static HANDLE    hInstance;
  20.     static FARPROC    lpProcAbout;
  21.  
  22.     switch(message) {
  23.  
  24.         case WM_CREATE:
  25.  
  26.             hInstance= GetWindowWord(hWnd, GWW_HINSTANCE);
  27.             return(0);
  28.  
  29.         case WM_COMMAND:
  30.         
  31.             switch(wParam) {
  32.  
  33.                 case IDM_STEPONE:
  34.  
  35.                     StepOne(hWnd);
  36.                     break;
  37.  
  38.                 case IDM_STEPTWO:
  39.  
  40.                     StepTwo(hWnd);
  41.                     break;
  42.  
  43.                 case IDM_ABOUT:
  44.  
  45.                     lpProcAbout= MakeProcInstance(About, hInstance);
  46.  
  47.                     if((DialogBox(hInstance,
  48.                         MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, lpProcAbout)) == -1) {
  49.  
  50.                         MessageBeep(0);
  51.                         MessageBox(hWnd, "Could not create dialog box!", "WARNING", MB_OK);
  52.  
  53.                     }
  54.  
  55.                     /* free dialog instance */
  56.                     FreeProcInstance(lpProcAbout);
  57.  
  58.                     break;
  59.  
  60.                 default:
  61.                     return(DefWindowProc(hWnd, message, wParam, lParam));
  62.  
  63.             }
  64.  
  65.             return(0);
  66.  
  67.         case WM_DESTROY:
  68.  
  69.             PostQuitMessage(0);
  70.             return(0);
  71.  
  72.         default:
  73.             return(DefWindowProc(hWnd, message, wParam, lParam));
  74.  
  75.     }
  76.  
  77.     return(0L);
  78.  
  79. } /* MainWndProc */
  80.